package com.csdj.t309springboot.controller;

import com.csdj.t309springboot.common.CacheConstant;
import org.springframework.util.StringUtils;

import javax.servlet.http.HttpServletRequest;

public class BaseController {

    public int getUid(HttpServletRequest request){
        String header = request.getHeader(CacheConstant.HEADER_UID);

        if(StringUtils.hasText(header)){
            return Integer.parseInt(header);
        }
        return 0;

    }




}
